import {createRequire} from 'module'
const require = createRequire(import.meta.url)
const express = require('express')
const financeRouter = express.Router()

/**
 * @api {get} /finance finance
 * @apiGroup finance
 * @apiParam name 用户
 */
financeRouter.get('/',function(req, res) {
    res.writeHead(200, {"Content-type": "text/html;charset=utf-8"})
    res.write("<p>雇员财务</p>")
    res.end()
})

/**
 * @api {get} /finance/insert insert
 * @apiGroup finance
 * @apiParam name 用户
 */
financeRouter.get('/insert',function(req, res) {
    res.writeHead(200, {"Content-type": "text/html;charset=utf-8"})
    res.write("<p>增加财务</p>")
    res.end()
})

/**
 * @api {get} /finance/delete delete
 * @apiGroup finance
 * @apiParam name 用户
 */
financeRouter.get('/delete',function(req, res) {
    res.writeHead(200, {"Content-type": "text/html;charset=utf-8"})
    res.write("<p>删除财务</p>")
    res.end()
})

/**
 * @api {get} /finance/update update
 * @apiGroup finance
 * @apiParam name 用户
 */
financeRouter.get('/update',function(req, res) {
    res.writeHead(200, {"Content-type": "text/html;charset=utf-8"})
    res.write("<p>修改财务</p>")
    res.end()
})

/**
 * @api {get} /finance/query query
 * @apiGroup finance
 * @apiParam name 用户
 */
financeRouter.get('/query',function(req, res) {
    res.writeHead(200, {"Content-type": "text/html;charset=utf-8"})
    res.write("<p>查询财务</p>")
    res.end()
})

export const finance = financeRouter